package com.h.blog;

import org.junit.jupiter.api.Test;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.util.UUID;

public class Security {
    @Test
    public void encrypt() {
        String password = "123456";
        String salt = UUID.randomUUID().toString().replace("-", "");
        System.out.println(salt);
        String s2 = DigestUtils.md5DigestAsHex((salt+password).getBytes(StandardCharsets.UTF_8));
        System.out.println(s2);
    }
}
